package com.cby.android.sample.bean.caiyun

import com.google.gson.annotations.SerializedName

/**
 * @description: CaiYunRealtimeBean
 *
 * @author ChenBaoyang
 * @date 4/27/21 09:25
 */
data class CaiYunRealtimeBean(
    /**
     * "status": "ok",
    "temperature": 21.16,
    "humidity": 0.68,
    "cloudrate": 0.3,
    "skycon": "WIND",
    "visibility": 12.3,
    "dswrf": 489.6,
    "wind": {
    "speed": 33.48,
    "direction": 45
    },
    "pressure": 99695.3,
    "apparent_temperature": 16.7,
     */
    var status: String,
    var temperature: Double,
    var humidity: Double,
    var cloudrate: String,
    var skycon: String,
    var visibility: String,
    var dswrf: String,
    var wind: CaiYunWindBean,
    var pressure: String,
    @SerializedName("apparent_temperature")
    var apparentTemperature: Double,
    var precipitation: CaiYunPrecipitationBean,
    @SerializedName("air_quality")
    var airQuality: CaiYunAirQualityBean,
    @SerializedName("life_index")
    var lifeIndex: CaiYunLifeIndexBean
){
    override fun toString(): String {
        return "CaiYunRealtimeBean(status='$status', temperature=$temperature, humidity=$humidity, cloudrate='$cloudrate', skycon='$skycon', visibility='$visibility', dswrf='$dswrf', wind=$wind, pressure='$pressure', apparentTemperature=$apparentTemperature, precipitation=$precipitation, airQuality=$airQuality, lifeIndex=$lifeIndex)"
    }
}



data class CaiYunWindBean(
    /**
     * "speed": 33.48,
    "direction": 45
     */
    var speed: Double,
    var direction: Double
){
    override fun toString(): String {
        return "CaiYunWindBean(speed=$speed, direction=$direction)"
    }
}

data class CaiYunPrecipitationBean(
    var local: CaiYunRainBean,
    var nearest: CaiYunRainBean
){
    override fun toString(): String {
        return "CaiYunPrecipitationBean(local=$local, nearest=$nearest)"
    }
}

data class CaiYunAirQualityBean(
    /**
     * "pm25": 5,
    "pm10": 0,
    "o3": 0,
    "so2": 0,
    "no2": 0,
    "co": 0,
    "aqi": {
    "chn": 9,
    "usa": 0
    },
    "description": {
    "usa": "",
    "chn": "优"
    }
     */
    var pm25: Double,
    var pm10: Double,
    var o3: Double,
    var so2: Double,
    var no2: Double,
    var co: Double,
    var aqi: CaiYunAqiBean,
    var description: CaiYunAqiBean

){
    override fun toString(): String {
        return "CaiYunAirQualityBean(pm25=$pm25, pm10=$pm10, o3=$o3, so2=$so2, no2=$no2, co=$co, aqi=$aqi, description=$description)"
    }
}

data class CaiYunAqiBean(
    /**
     * "chn": 9,
    "usa": 0
     */
    var chn: String,
    var usa: String
){
    override fun toString(): String {
        return "CaiYunAqiBean(chn=$chn, usa=$usa)"
    }
}

data class CaiYunLifeIndexBean(

    var ultraviolet: CaiYunIndexBean,
    var comfort: CaiYunIndexBean
){
    override fun toString(): String {
        return "CaiYunLifeIndexBean(ultraviolet=$ultraviolet, comfort=$comfort)"
    }
}

data class CaiYunIndexBean(
    /**
     * "index": 5,
    "desc": "舒适"
     */
    var index: Int,
    var desc: String
){
    override fun toString(): String {
        return "CaiYunIndexBean(index=$index, desc='$desc')"
    }
}




data class CaiYunRainBean(
    /**
     * "status": "ok",
    "datasource": "radar",
    "distance": 5,
    "intensity": 0
     */
    var status: String,
    var datasource: String,
    var distance: Double,
    var intensity: Double
){
    override fun toString(): String {
        return "CaiYunRainBean(status='$status', datasource='$datasource', distance=$distance, intensity=$intensity)"
    }
}
